@extends('home.layout')

@section('content')
    <div class="m-tab">
        <div class="m-title"><h3>一共找到 <font style="color:red"> {{ $data->total() }} </font> 个结果 </h3></div>
        @foreach($data as $key=>$value)
            <div class="arlist">
                <a onfocus="this.blur()" title="{{ $value->title }}" href="{{ get_home_url($value->document_type.'/detail/'.$value->id) }}" target="_blank">
                    <img src="{{ get_upload_url($value->cover) }}" width="145">
                    <span style="display:inline; vertical-align:top;">
                        <h2>
                            {!! str_replace($keywords, '<font style="color:red">'.$keywords.'</font>', $value->title) !!}
                        </h2>
                    </span>
                </a>
                <span>{{ $value->fixed_release_time }}&nbsp;&nbsp;&nbsp;&nbsp;点击:{{ $value->click }}</span>
                <p>{!! str_replace($keywords, '<font style="color:red">'.$keywords.'</font>', $value->description) !!}......</p>
                <div class="clear"></div>
            </div>
        @endforeach


        <div class="pagelist yx-u pagination pagination-sm">
            {{ $data->appends(['keywords' => $keywords])->links() }}
        </div>
    </div>
@endsection

@section('style')
    <style type="text/css">
        .arlist { padding:10px 15px; border-bottom:1px dashed #CCC;line-height:25px;}
        .arlist img {float:left; margin:5px; padding-right:5px;}
        .arlist a h2{ font-size:14px; font-weight:600; color:#2974c5;}
        .arlist span{display:block;font-size:12px; color:#999;}
        .arlist p{display:block; color:#666;}
        .clear {clear:both; line-height:normal;}

        .pagination {
            display: inline-block;
            padding-left: 0;
            margin: 22px 0;
            border-radius: 4px;
        }
        .pagination > li {
            display: inline;
        }
        .pagination-sm > li:first-child > a, .pagination-sm > li:first-child > span {
            border-bottom-left-radius: 3px;
            border-top-left-radius: 3px;
        }
        .pagination > .active > a, .pagination > .active > a:hover, .pagination > .active > a:focus, .pagination > .active > span, .pagination > .active > span:hover, .pagination > .active > span:focus {
            z-index: 3;
            color: #fff;
            background-color: #1aa3b5;
            border-color: #1aa3b5;
            cursor: default;
        }
        .pagination-sm > li > a, .pagination-sm > li > span {
            padding: 5px 10px;
            font-size: 12px;
            line-height: 1.5;
        }

        .pagination>li>a {
            background: #fafafa;
            color: #666;
        }

        .pagination-sm > li > a, .pagination-sm > li > span {
            padding: 5px 10px;
            font-size: 12px;
            line-height: 1.5;
        }

        .pagination > li > a, .pagination > li > span {
            position: relative;
            float: left;
            padding: 6px 12px;
            line-height: 1.6;
            text-decoration: none;
            color: #1aa3b5;
            background-color: #e6fff5;
            border: 1px solid #ddd;
            margin-left: -1px;
        }
    </style>
@endsection